package com.juphoon.oauth.core.listener;

import javax.servlet.http.HttpServletRequest;

/**
 * @author rongbin.huang
 * @create 2018-06-28 下午11:08
 **/
public interface AuthenticationListener {

    /**
     * 登录成功回调
     * @param request
     * @param principal
     * @param accessToken
     */
    void loginSuccess(HttpServletRequest request, Object principal, String accessToken);

    /**
     * 登录失败回调
     * @param request
     * @param exception
     */
    void loginFail(HttpServletRequest request, Exception exception);

    /**
     * 退出回调
     * @param request
     */
    void logout(HttpServletRequest request);

    /**
     * token刷新回调
     * @param request
     * @param accessToken
     */
    void refreshToken(HttpServletRequest request, String accessToken);

}
